Skip to content

[libsolidity] Refactor Compiler Stack imported source type. #13578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

aarlt
Copy link
Member

@aarlt aarlt commented Sep 28, 2022

Refactors libsolidity/interface/CompilerStack.cpp to make #12834 more readable.

nikola-matic
nikola-matic previously approved these changes Oct 18, 2022
Copy link
Collaborator

@nikola-matic nikola-matic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like this approach more than the ternary operator, although @cameel and/or @ekpyron may disagree. However, I do find it weird that this isn't covered by any unit tests and feel as though it should probably be done in test/libsolidity/Metadata.cpp. In any case, I'd prefer to have this covered by tests, but since you'll need the final sign off by @cameel or @ekpyron for merging, I'm comfortable with approving this.

string sourceType;
switch (m_importedSourceType)
{
case ImportedSourceType::None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is technically in line with the previous implementation using bool, but it's kind of confusing that None returns Solidity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we should just call it compilationSourceType or something. The metadata also just calls it "sourceType". At some point we might also use "Yul" as source type, so this has nothing to do with it being imported or not.

@chriseth chriseth merged commit 08af255 into develop Oct 20, 2022
@chriseth chriseth deleted the imported-source-type-refactoring branch October 20, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants